﻿package mortal.game.view.hangCount.renderer
{
    import com.mui.controls.*;
    import com.mui.utils.*;
    import mortal.game.view.common.item.*;
    import mortal.game.view.hangCount.data.*;

    public class HangCountItemListCellRenderer extends GCellRenderer
    {
        private var _item:BaseItem;

        public function HangCountItemListCellRenderer()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._item = UICompomentPool.getUICompoment(BaseItem);
            this._item.setItemStyle(ItemStyleConst.Small);
            this._item.isShowLock = true;
            this._item.isBind = true;
            this._item.isDragAble = false;
            this.addChild(this._item);
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            super.data = param1;
            if (param1 is HangUpItemData)
            {
                this._item.itemData = (param1 as HangUpItemData).itemData;
                this._item.amount = (param1 as HangUpItemData).amount;
            }
            else
            {
                this._item.itemData = null;
            }
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl();
            this._item.dispose();
            this._item = null;
            return;
        }// end function

    }
}
